export default {
  created() {
    if (this.item && this.item.vdStrEqualTo !== undefined && this.formData != null) {
      var label = this.item.getLabel();
      var me = this;
      this.$emit("componentNotify", "addRule", {
        field: this.item.name,
        rules: [
          { required: true, message: "请填写" + label },
          {
            required: true,
            // trigger: "blur",
            validator: (rule, value, callback) =>{
              if (value != this.formData[this.item.vdStrEqualTo]) {
                callback(new Error("两次输入不一致"));
                return;
              }
              callback();
            },
          }
        ]
      });
    }
  }
};
